<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>管理员首页</title>

    <!-- Bootstrap -->
    <link href="${pageContext.request.contextPath}/statics/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link href="${pageContext.request.contextPath}/statics/css/font-awesome.min.css" rel="stylesheet">
    <!-- NProgress -->
    <link href="${pageContext.request.contextPath}/statics/nprogress.css" rel="stylesheet">
    <!-- iCheck -->
    <link href="${pageContext.request.contextPath}/statics/css/green.css" rel="stylesheet">
    <!-- bootstrap-progressbar -->
    <link href="${pageContext.request.contextPath}/statics/css/bootstrap-progressbar-3.3.4.min.css" rel="stylesheet">
    <!-- JQVMap -->
    <link href="${pageContext.request.contextPath}/statics/css/jqvmap.min.css" rel="stylesheet"/>
    <!-- Custom Theme Style -->
    <link href="${pageContext.request.contextPath}/statics/css/custom.min.css" rel="stylesheet">
</head>

<body class="nav-md">
<div class="container body">
    <div class="main_container">
        <div class="col-md-3 left_col">
            <div class="left_col scroll-view">
                <div class="navbar nav_title" style="border: 0;">
                    <a href="index.html" class="site_title"><i class="fa fa-paw"></i> <span>BeyondPlatfrom</span></a>
                </div>

                <div class="clearfix"></div>

                <!-- menu profile quick info -->
                <div class="profile">
                    <div class="profile_pic">
                        <img src="${pageContext.request.contextPath}/statics/images/img.jpg" alt="..."
                             class="img-circle profile_img">
                    </div>
                    <div class="profile_info">
                        <span>欢迎你,</span>
                        <h2>${backendUser.userName}</h2>
                    </div>
                </div>
                <!-- /menu profile quick info -->

                <br/>

                <!-- sidebar menu -->
                <div id="sidebar-menu" class="main_menu_side hidden-print main_menu">
                    <div class="menu_section">
                        <h3>测试人员</h3>
                        <ul class="nav side-menu">
                            <li><a><i class="fa fa-home"></i> 开发者账户管理 <span class="fa fa-chevron-down"></span></a>
                                <ul class="nav child_menu">
                                    <li><a href="index.html">用户中心</a></li>
                                </ul>
                            </li>
                            <li><a><i class="fa fa-desktop"></i> 手游应用管理 <span class="fa fa-chevron-down"></span></a>
                                <ul class="nav child_menu">
                                    <li>
                                        <a href="${pageContext.request.contextPath}/devController/toDevAppList">手游应用维护</a>
                                    </li>
                                </ul>
                            </li>
                        </ul>
                    </div>

                </div>
                <!-- /sidebar menu -->


                <!-- menu footer buttons -->
                <div class="sidebar-footer hidden-small">
                    <a data-toggle="tooltip" data-placement="top" title="Settings">
                        <span class="glyphicon glyphicon-cog" aria-hidden="true"></span>
                    </a>
                    <a data-toggle="tooltip" data-placement="top" title="FullScreen">
                        <span class="glyphicon glyphicon-fullscreen" aria-hidden="true"></span>
                    </a>
                    <a data-toggle="tooltip" data-placement="top" title="Lock">
                        <span class="glyphicon glyphicon-eye-close" aria-hidden="true"></span>
                    </a>
                    <a data-toggle="tooltip" data-placement="top" title="Logout">
                        <span class="glyphicon glyphicon-off" aria-hidden="true"></span>
                    </a>
                </div>
                <!-- /menu footer buttons -->
            </div>
        </div>

        <!-- top navigation -->
        <div class="top_nav">
            <div class="nav_menu">
                <nav>
                    <div class="nav toggle">
                        <a id="menu_toggle"><i class="fa fa-bars"></i></a>
                    </div>

                    <ul class="nav navbar-nav navbar-right">
                        <li class="">
                            <a href="javascript:;" class="user-profile dropdown-toggle" data-toggle="dropdown"
                               aria-expanded="false">
                                <img src="${pageContext.request.contextPath}/statics/images/img.jpg"
                                     alt="">${devUser.devName}
                                <span class=" fa fa-angle-down"></span>
                            </a>
                            <ul class="dropdown-menu dropdown-usermenu pull-right">
                                <li><a href="${pageContext.request.contextPath}/devUserController/logout"><i
                                        class="fa fa-sign-out pull-right"></i> Log Out</a></li>
                            </ul>
                        </li>
                    </ul>
                </nav>
            </div>
        </div>
        <!-- /top navigation -->

        <!-- page content -->
        <div class="right_col" role="main">
            <%--header/haode--%>

            <div class="clearfix"></div>
            <div class="row">
                <div class="col-md-12 col-sm-12 col-xs-12">
                    <div class="x_panel">

                        <div class="x_title">
                            <h2>修改APP基础信息</h2>
                            <div class="clearfix"></div>
                        </div>
                        <div class="x_content1">
                            <form class="form-horizontal form-label-left"
                                  action="${pageContext.request.contextPath}/devController/doUpdate" method="post"
                                  enctype="multipart/form-data">
                                <input type="hidden" name="id" value="${appInfo.id}">
                                <div class="item form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">软件名称 <span
                                            class="required">*</span>
                                    </label>
                                    <div class="col-md-6 col-sm-6 col-xs-12">
                                        <input class="form-control col-md-7 col-xs-12" value="${appInfo.softwareName }"
                                               type="text" name="softwareName">
                                    </div>
                                </div>
                                <div class="item form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">APK名称 <span
                                            class="required">*</span>
                                    </label>
                                    <div class="col-md-6 col-sm-6 col-xs-12">
                                        <input type="text" class="form-control col-md-7 col-xs-12"
                                               value="${appInfo.APKName }" name="APKname">
                                    </div>
                                </div>

                                <div class="item form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">支持ROM <span
                                            class="required">*</span>
                                    </label>
                                    <div class="col-md-6 col-sm-6 col-xs-12">
                                        <input class="form-control col-md-7 col-xs-12"
                                               value="${appInfo.supportROM }" type="text">
                                    </div>
                                </div>
                                <div class="item form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">界面语言 <span
                                            class="required">*</span>
                                    </label>
                                    <div class="col-md-6 col-sm-6 col-xs-12">
                                        <input class="form-control col-md-7 col-xs-12"
                                               value="${appInfo.interfaceLanguage }" type="text"
                                               name="interfaceLanguage">
                                    </div>
                                </div>
                                <div class="item form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">软件大小 <span
                                            class="required">*</span>
                                    </label>
                                    <div class="col-md-6 col-sm-6 col-xs-12">
                                        <input type="text" value="${appInfo.softwareSize}"
                                               class="form-control col-md-7 col-xs-12" name="softwareSize"
                                               pattern="[0-9]{1,5}" title="软件大小只能填写数字">
                                    </div>
                                </div>

                                <div class="item form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">下载次数 <span
                                            class="required">*</span>
                                    </label>
                                    <div class="col-md-6 col-sm-6 col-xs-12">
                                        <input type="text" value="${appInfo.downloads }"
                                               class="form-control col-md-7 col-xs-12" name="downloads"
                                               required="required" pattern="[0-9]{1,5}" title="下载次数只能填写数字">
                                    </div>
                                </div>
                                <div class="item form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">所属平台 <span
                                            class="required">*</span></label>
                                    <div class="col-md-6 col-sm-6 col-xs-12">
                                        <input type="hidden" value="${appInfo.flatformId}" id="flatform">
                                        <select name="flatformId" id="flatformId" class="form-control"
                                                required="required">
                                            <option value="${appInfo.flatformId}">${appInfo.flatformName}</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="item form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">一级分类 <span
                                            class="required">*</span></label>
                                    <div class="col-md-6 col-sm-6 col-xs-12">
                                        <input type="hidden" value="${appInfo.categoryLevel1}" id="level1">
                                        <select name="categoryLevel1" id="categoryLevel1" class="form-control"
                                                required="required">
                                            <option value="${appInfo.categoryLevel1}">${appInfo.categoryLevel1Name}</option>
                                        </select>
                                    </div>
                                </div>

                                <div class="item form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">二级分类 <span
                                            class="required">*</span></label>
                                    <div class="col-md-6 col-sm-6 col-xs-12">
                                        <input type="hidden" value="${appInfo.categoryLevel2}" id="level2">
                                        <select name="categoryLevel2" id="categoryLevel2" class="form-control"
                                                required="required">
                                            <option value="${appInfo.categoryLevel2}">${appInfo.categoryLevel2Name}</option>
                                        </select>
                                    </div>
                                </div>

                                <div class="item form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">三级分类 <span
                                            class="required">*</span></label>
                                    <div class="col-md-6 col-sm-6 col-xs-12">
                                        <input type="hidden" value="${appInfo.categoryLevel3}" id="level3">
                                        <select name="categoryLevel3" id="categoryLevel3" class="form-control"
                                                required="required">
                                            <option value="${appInfo.categoryLevel3}">${appInfo.categoryLevel3Name}</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="item form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">APP状态 <span
                                            class="required">*</span>
                                    </label>
                                    <div class="col-md-6 col-sm-6 col-xs-12">
                                        <input type="text" class="form-control col-md-7 col-xs-12" readonly="readonly"
                                               value="${appInfo.statusName }" name="statusName">
                                    </div>
                                </div>
                                <div class="item form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">应用简介 <span
                                            class="required">*</span>
                                    </label>
                                    <div class="col-md-6 col-sm-6 col-xs-12">
                                          <textarea class="form-control col-md-7 col-xs-12" name="appInfo">${appInfo.appInfo }</textarea>
                                    </div>
                                </div>
                                <div class="item form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">LOGO图片 <span
                                            class="required">*</span>
                                    </label>
                                    <div class="col-md-6 col-sm-6 col-xs-12" id="file" style="display: none">
                                        <input type="file" class="form-control col-md-7 col-xs-12" name="attach"
                                               id="attach"/>
                                    </div>
                                    ${uploadFileError }
                                    <div class="col-md-6 col-sm-6 col-xs-12" id="img">
                                        <img src="${appInfo.logoPicPath}" width="50px" height="50px"/>
                                        <a href="javaScript:;" onclick="delImg(${appInfo.id})">删除</a>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-md-6 col-md-offset-3">
                                        <c:if test="${appInfo.status == 3}">
                                            <button id="send" type="submit" name="status" value="1"
                                                    class="btn btn-success">保存并再次提交审核
                                            </button>
                                        </c:if>
                                        <button type="submit" class="btn btn-success">保存</button>
                                        <a href="${pageContext.request.contextPath}/devController/toDevAppList">
                                            <button type="button" class="btn btn-primary" id="back">返回</button>
                                        </a>
                                    </div>
                                </div>
                            </form>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                </div>
            </div>
            <!-- /page content -->

            <!-- footer content -->
            <footer>
                <div class="pull-right">
                    Gentelella - Bootstrap Admin Template by <a href="https://colorlib.com">Colorlib</a>
                </div>
                <div class="clearfix"></div>
            </footer>
            <!-- /footer content -->
        </div>
    </div>
    <!-- jQuery -->
    <script src="${pageContext.request.contextPath}/statics/js/jquery-1.8.3.js"></script>
    <script src="${pageContext.request.contextPath}/statics/js/jquery-1.12.4.js"></script>
    <script>
        var path = "${pageContext.request.contextPath}";

        function delImg(id) {
            if (confirm("确定删除吗？")) {
                $.getJSON(path + "/devController/delImg/" + id, function (data) {
                    if (data) {
                        $("#file").show();
                        $("#img").remove();
                        alert("删除图片成功！");
                    } else {
                        alert("删除失败！");
                    }
                });
            }
        }

        $(function () {
            $.getJSON("/BeyondPlatfrom/devController/findApp", "", function (data) {
                $("#flatformId").html("");
                var str = " <option value=\"0\">请选择所属平台</option>";
                for (var i = 0; i < data.length; i++) {
                    if ($("#flatform").val() == data[i].valueId) {
                        str += "<option selected value=" + data[i].valueId + ">" + data[i].valueName + "</option>"
                    } else {
                        str += "<option  value=" + data[i].valueId + ">" + data[i].valueName + "</option>"
                    }
                }
                $("#flatformId").html(str);
            });
            $.getJSON("/BeyondPlatfrom/devController/getLevel1", {parentId: 1}, function (data) {
                $("#categoryLevel1").html("");
                var str = " <option value=\"0\">请选择一级分类</option>";
                for (var i = 0; i < data.length; i++) {
                    if ($("#level1").val() == data[i].id) {
                        str += "<option selected value=" + data[i].id + ">" + data[i].categoryName + "</option>"
                    } else {
                        str += "<option  value=" + data[i].id + ">" + data[i].categoryName + "</option>"
                    }
                }
                $("#categoryLevel1").html(str);
            });

            //回显
            $.getJSON("/BeyondPlatfrom/devController/levelCassify", {parentId: $("#level1").val()}, function (data) {
                $("#queryCategoryLevel2").html("");
                var str = " <option value=\"0\">请选择二级分类</option>";
                for (var i = 0; i < data.length; i++) {
                    if ($("#level2").val() == data[i].id) {
                        str += "<option selected value=" + data[i].id + ">" + data[i].categoryName + "</option>"
                    } else {
                        str += "<option  value=" + data[i].id + ">" + data[i].categoryName + "</option>"
                    }
                }
                $("#queryCategoryLevel2").html(str);
            });


            $("#categoryLevel1").change(function () {
                var id = $("#queryCategoryLevel1").val();
                $.getJSON("/BeyondPlatfrom/devController/levelCassify", {parentId: id}, function (data) {
                    $("#categoryLevel2").html("");
                    var str = " <option value=\"0\">请选择二级分类</option>";
                    for (var i = 0; i < data.length; i++) {
                        str += "<option  value=" + data[i].id + ">" + data[i].categoryName + "</option>"
                    }
                    $("#categoryLevel2").html(str);
                });
            });


            //回显
            $.getJSON("/BeyondPlatfrom/devController/levelCassify", {parentId: $("#level2").val()}, function (data) {
                $("#queryCategoryLevel3").html("");
                var str = " <option value=\"0\">请选择三级分类</option>";
                for (var i = 0; i < data.length; i++) {
                    if ($("#level3").val() == data[i].id) {
                        str += "<option selected value=" + data[i].id + ">" + data[i].categoryName + "</option>"
                    } else {
                        str += "<option  value=" + data[i].id + ">" + data[i].categoryName + "</option>"
                    }
                }
                $("#queryCategoryLevel3").html(str);
            });

            $("#categoryLevel2").change(function () {
                var id = $("#categoryLevel2").val();
                $.getJSON("/BeyondPlatfrom/devController/levelCassify", {parentId: id}, function (data) {
                    $("#categoryLevel3").html("");
                    var str = " <option value=\"0\">请选择三级分类</option>";
                    for (var i = 0; i < data.length; i++) {
                        str += "<option  value=" + data[i].id + ">" + data[i].categoryName + "</option>"
                    }
                    $("#categoryLevel3").html(str);
                });
            });
        });
    </script>
    <!-- jQuery -->
    <script src="${pageContext.request.contextPath}/statics/vendors/jquery/dist/jquery.min.js"></script>
    <!-- Bootstrap -->
    <script src="${pageContext.request.contextPath}/statics/vendors/bootstrap/dist/js/bootstrap.min.js"></script>
    <!-- Custom Theme Scripts -->
    <script src="${pageContext.request.contextPath}/statics/js/custom.min.js"></script>

    <!-- Flot -->
    <script>
        $(document).ready(function () {
            var data1 = [
                [gd(2012, 1, 1), 17],
                [gd(2012, 1, 2), 74],
                [gd(2012, 1, 3), 6],
                [gd(2012, 1, 4), 39],
                [gd(2012, 1, 5), 20],
                [gd(2012, 1, 6), 85],
                [gd(2012, 1, 7), 7]
            ];

            var data2 = [
                [gd(2012, 1, 1), 82],
                [gd(2012, 1, 2), 23],
                [gd(2012, 1, 3), 66],
                [gd(2012, 1, 4), 9],
                [gd(2012, 1, 5), 119],
                [gd(2012, 1, 6), 6],
                [gd(2012, 1, 7), 9]
            ];
            $("#canvas_dahs").length && $.plot($("#canvas_dahs"), [
                data1, data2
            ], {
                series: {
                    lines: {
                        show: false,
                        fill: true
                    },
                    splines: {
                        show: true,
                        tension: 0.4,
                        lineWidth: 1,
                        fill: 0.4
                    },
                    points: {
                        radius: 0,
                        show: true
                    },
                    shadowSize: 2
                },
                grid: {
                    verticalLines: true,
                    hoverable: true,
                    clickable: true,
                    tickColor: "#d5d5d5",
                    borderWidth: 1,
                    color: '#fff'
                },
                colors: ["rgba(38, 185, 154, 0.38)", "rgba(3, 88, 106, 0.38)"],
                xaxis: {
                    tickColor: "rgba(51, 51, 51, 0.06)",
                    mode: "time",
                    tickSize: [1, "day"],
                    //tickLength: 10,
                    axisLabel: "Date",
                    axisLabelUseCanvas: true,
                    axisLabelFontSizePixels: 12,
                    axisLabelFontFamily: 'Verdana, Arial',
                    axisLabelPadding: 10
                },
                yaxis: {
                    ticks: 8,
                    tickColor: "rgba(51, 51, 51, 0.06)",
                },
                tooltip: false
            });

            function gd(year, month, day) {
                return new Date(year, month - 1, day).getTime();
            }
        });
    </script>
    <!-- /Flot -->

    <!-- JQVMap -->
    <script>
        $(document).ready(function () {
            $('#world-map-gdp').vectorMap({
                map: 'world_en',
                backgroundColor: null,
                color: '#ffffff',
                hoverOpacity: 0.7,
                selectedColor: '#666666',
                enableZoom: true,
                showTooltip: true,
                values: sample_data,
                scaleColors: ['#E6F2F0', '#149B7E'],
                normalizeFunction: 'polynomial'
            });
        });
    </script>
    <!-- /JQVMap -->

    <!-- Skycons -->
    <script>
        $(document).ready(function () {
            var icons = new Skycons({
                    "color": "#73879C"
                }),
                list = [
                    "clear-day", "clear-night", "partly-cloudy-day",
                    "partly-cloudy-night", "cloudy", "rain", "sleet", "snow", "wind",
                    "fog"
                ],
                i;

            for (i = list.length; i--;)
                icons.set(list[i], list[i]);

            icons.play();
        });
    </script>
    <!-- /Skycons -->

    <!-- Doughnut Chart -->
    <script>
        $(document).ready(function () {
            var options = {
                legend: false,
                responsive: false
            };

            new Chart(document.getElementById("canvas1"), {
                type: 'doughnut',
                tooltipFillColor: "rgba(51, 51, 51, 0.55)",
                data: {
                    labels: [
                        "Symbian",
                        "Blackberry",
                        "Other",
                        "Android",
                        "IOS"
                    ],
                    datasets: [{
                        data: [15, 20, 30, 10, 30],
                        backgroundColor: [
                            "#BDC3C7",
                            "#9B59B6",
                            "#E74C3C",
                            "#26B99A",
                            "#3498DB"
                        ],
                        hoverBackgroundColor: [
                            "#CFD4D8",
                            "#B370CF",
                            "#E95E4F",
                            "#36CAAB",
                            "#49A9EA"
                        ]
                    }]
                },
                options: options
            });
        });
    </script>
    <!-- /Doughnut Chart -->

    <!-- bootstrap-daterangepicker -->
    <script>
        $(document).ready(function () {

            var cb = function (start, end, label) {
                console.log(start.toISOString(), end.toISOString(), label);
                $('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
            };

            var optionSet1 = {
                startDate: moment().subtract(29, 'days'),
                endDate: moment(),
                minDate: '01/01/2012',
                maxDate: '12/31/2015',
                dateLimit: {
                    days: 60
                },
                showDropdowns: true,
                showWeekNumbers: true,
                timePicker: false,
                timePickerIncrement: 1,
                timePicker12Hour: true,
                ranges: {
                    'Today': [moment(), moment()],
                    'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
                    'Last 7 Days': [moment().subtract(6, 'days'), moment()],
                    'Last 30 Days': [moment().subtract(29, 'days'), moment()],
                    'This Month': [moment().startOf('month'), moment().endOf('month')],
                    'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
                },
                opens: 'left',
                buttonClasses: ['btn btn-default'],
                applyClass: 'btn-small btn-primary',
                cancelClass: 'btn-small',
                format: 'MM/DD/YYYY',
                separator: ' to ',
                locale: {
                    applyLabel: 'Submit',
                    cancelLabel: 'Clear',
                    fromLabel: 'From',
                    toLabel: 'To',
                    customRangeLabel: 'Custom',
                    daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
                    monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
                    firstDay: 1
                }
            };
            $('#reportrange span').html(moment().subtract(29, 'days').format('MMMM D, YYYY') + ' - ' + moment().format('MMMM D, YYYY'));
            $('#reportrange').daterangepicker(optionSet1, cb);
            $('#reportrange').on('show.daterangepicker', function () {
                console.log("show event fired");
            });
            $('#reportrange').on('hide.daterangepicker', function () {
                console.log("hide event fired");
            });
            $('#reportrange').on('apply.daterangepicker', function (ev, picker) {
                console.log("apply event fired, start/end dates are " + picker.startDate.format('MMMM D, YYYY') + " to " + picker.endDate.format('MMMM D, YYYY'));
            });
            $('#reportrange').on('cancel.daterangepicker', function (ev, picker) {
                console.log("cancel event fired");
            });
            $('#options1').click(function () {
                $('#reportrange').data('daterangepicker').setOptions(optionSet1, cb);
            });
            $('#options2').click(function () {
                $('#reportrange').data('daterangepicker').setOptions(optionSet2, cb);
            });
            $('#destroy').click(function () {
                $('#reportrange').data('daterangepicker').remove();
            });
        });
    </script>
    <!-- /bootstrap-daterangepicker -->

    <!-- gauge.js -->
    <script>
        var opts = {
            lines: 12,
            angle: 0,
            lineWidth: 0.4,
            pointer: {
                length: 0.75,
                strokeWidth: 0.042,
                color: '#1D212A'
            },
            limitMax: 'false',
            colorStart: '#1ABC9C',
            colorStop: '#1ABC9C',
            strokeColor: '#F0F3F3',
            generateGradient: true
        };
        var target = document.getElementById('foo'),
            gauge = new Gauge(target).setOptions(opts);

        gauge.maxValue = 6000;
        gauge.animationSpeed = 32;
        gauge.set(3200);
        gauge.setTextField(document.getElementById("gauge-text"));
    </script>
    <!-- /gauge.js -->
</div>

</body>
</html>
